#页面类
from Day16.Base import Base
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from time import sleep
class Page(Base):
    #定位器
    search_loc=(By.NAME,'key')
    #页面元素的封装
    def search(self):
        self.send_keys(self.search_loc,'五粮液')
        self.click(self.button_loc)
        sleep(5)


    #搜索按钮
    button_loc=(By.CLASS_NAME,'search-bth')

    def button(self):
        # self.click(self.button_loc)
        #键盘事件封装
        self.keys_enter(self.button_loc,Keys.ENTER)
    #业务逻辑
    def luoji_jiuxian_01(self):

        self.open_url('https: // www.jiuxian.com /')
        self.search()
        sleep(5)
        self.button()